FileUploadImageDetailForm1 = Ext.extend(Ext.Window, {
	constructor : function(a) {
		Ext.applyIf(this, a);
		this.initUIComponents();
		FileUploadImageDetailForm1.superclass.constructor.call(this, {
			id : "FileUploadImageDetailFormWin",
			layout : "fit",
			iconCls : "menu-relativeJob",
			items : this.formPanel,
			modal : true,
			height : 120,
			width : 350,
			maximizable : true,
			title : "新增/编辑图片分类信息",
			buttonAlign : "center",
			buttons : [ {
				text : "保存",
				iconCls : "btn-save",
				scope : this,
				handler : this.save
			}, {
				text : "取消",
				iconCls : "btn-cancel",
				scope : this,
				handler : this.cancel
			} ]
		});
	},
	initUIComponents : function() {
		this.formPanel = new Ext.FormPanel({
			id : "FileUploadImageDetailForm1",
			layout : "form",
			bodyStyle : "padding:10px",
			border : false,
			autoScroll : true,
			defaults : {
				anchor : "96%,96%"
			},
			keys : {
				key : Ext.EventObject.ENTER,
				fn : this.save,
				scope : this
			},
			defaultType : "textfield",
			reader : new Ext.data.JsonReader({
				root : "data"
			}),
			items : [{
				fieldLabel : "图片分类名称",
				name : "treeName",
				id : "treeName",
				allowBlank : false,
				regex: /^[\da-zA-Z\u4E00-\u9FA5]{1,30}$/,  
                regexText:'不能输入特殊符号，最大长度30位！',   
				blankText : "请输入图片分类名称",
				maxLength : 128
			}]
		});
	},
	cancel : function() {
		this.close();
	},
	save : function() {
		var treeName=Ext.getCmp("treeName").getValue();
		$postForm({
			formPanel : this.formPanel,
			scope : this,
			url : __ctxPath+"/file-upload?treeName="+treeName+"&catkey="+this.catKey+"&flag=1",		
			callback : function(a, b) {
				Ext.getCmp("FileUploadImageDetailFormWin").close();
				Ext.getCmp("fileUploadManagerImageTreePanel").root.reload();
			}
		});
	}
});
